
import pythoncom as com

CLSID_FilterGraph = "{E436EBB3-524F-11CE-9F53-0020AF0BA770}"
IID_IGraphBuilder = "{56A868A9-0AD4-11CE-B03A-0020AF0BA770}"
IID_IMediaControl = "{56A868B1-0AD4-11CE-B03A-0020AF0BA770}"
IID_IVideoWindow  = "{56A868B4-0AD4-11CE-B03A-0020AF0BA770}"
IID_IMediaEventEx = "{56a868c0-0ad4-11ce-b03a-0020af0ba770}"

CLSID_CaptureGraphBuilder2 = "{BF87B6E1-8C27-11d0-B3F0-00AA003761C5}"
IID_ICaptureGraphBuilder2 = "{93E5A4E0-2D50-11D2-ABFA-00A0C9C6E38D}"

CLSID_SystemDeviceEnum = "{62BE5D10-60EB-11d0-BD3B-00A0C911CE86}"


def zapit():
    iGraphBuilder = com.CoCreateInstance(CLSID_FilterGraph, None, com.CLSCTX_INPROC, IID_IGraphBuilder)
    iCaptureGraphBuilder = com.CoCreateInstance(CLSID_CaptureGraphBuilder2, None, com.CLSCTX_INPROC, IID_ICaptureGraphBuilder2)
    iMediaControl = iGraphBuilder.QueryInterface(IID_IMediaControl)
    iVideoWindow = iGraphBuilder.QueryInterface(IID_IVideoWindow)
    iMediaEvent = iGraphBuilder.QueryInterface(IID_IMediaEventEx)
    print iGraphBuilder, iCaptureGraphBuilder